<template>
    <h3 style="margin-left: 25px;font-family: KaiTi">欢迎使用换电柜App</h3>
    <img src="@/assets/images/tiaokuan1.png" style="width: 100%"/>
  <img src="@/assets/images/tiaokuan.png" style="width: 100%"/>

  <div style="bottom: 30px; position: absolute;width: 100%">
    <van-button round type="primary" style="width: 100%;" @click="saveUseBattery">确定使用</van-button>
  </div>
</template>
<script setup >

import {ElMessage} from "element-plus";
import {useRouter} from "vue-router";
import {addUseBattery} from "@/api/useBattery.js";

const router = useRouter()
const saveUseBattery = async () => {
  const {data}  = await addUseBattery(localStorage.getItem('reservation')??null)
  if (data.code === 200){
    ElMessage.success("操作成功")
    localStorage.removeItem('reservation')
    localStorage.setItem('isUse',true)
    router.push("/home")
  }
}
</script>